-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
ref(analytics): Transform analytics events for TET-826 #95206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
- Transform event classes to use @analytics.eventclass decorator - Transform analytics.record calls to use event class instances - Update imports as needed Closes TET-826
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #95206 +/- ##
==========================================
+ Coverage 80.46% 87.84% +7.38%
==========================================
Files 10478 10478
Lines 605960 605789 -171
Branches 23674 23641 -33
==========================================
+ Hits 487562 532140 +44578
+ Misses 118034 73289 -44745
+ Partials 364 360 -4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Incorrect Type Annotations for IDs
The organization_id
and project_id
attributes in PreprodArtifactApiAssembleEvent
, PreprodArtifactApiUpdateEvent
, and PreprodArtifactApiAssembleGenericEvent
are incorrectly type-annotated as str
. They should be int
as they receive integer IDs from Django models (e.g., project.organization_id
, project.id
).
src/sentry/preprod/analytics.py#L5-L20
sentry/src/sentry/preprod/analytics.py
Lines 5 to 20 in 5ebe849
class PreprodArtifactApiAssembleEvent(analytics.Event): | |
organization_id: str | |
project_id: str | |
user_id: int | None = None | |
@analytics.eventclass("preprod_artifact.api.update") | |
class PreprodArtifactApiUpdateEvent(analytics.Event): | |
organization_id: str | |
project_id: str | |
@analytics.eventclass("preprod_artifact.api.assemble_generic") | |
class PreprodArtifactApiAssembleGenericEvent(analytics.Event): | |
organization_id: str | |
project_id: str |
Was this report helpful? Give feedback by reacting with 👍 or 👎
Closes TET-826